package com.hotel.controller;

import com.hotel.domain.CheckIn;
import com.hotel.domain.Food;
import com.hotel.service.checkInService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @author shenlei
 * @describ
 * @create 2020-12-08 23:33
 */
@RequestMapping("/admin")
@RestController
public class checkInController {
    @Autowired
    checkInService checkInService;
    //查询登记信息
    @GetMapping("/ListCheckin")
    public List<CheckIn> findAllcheckInfo(){
        return checkInService.findAllCheckIn();
    }
    //保存登记信息

    @PostMapping("/saveCheckin")
    public void saveCheckin(){
        CheckIn checkIn = new CheckIn();
        checkIn.setRoomType("标准房");
        checkIn.setEndtime(new Date());
        checkIn.setRoomId(33);
        checkInService.savecheckInfo(checkIn);


    }

}
